<%-- 
    Document   : listarTodosFunci
    Created on : 22/10/2011, 16:32:14
    Author     : Alex
--%>

<%@page import="com.aula.web.alex.Funcionario"%>
<%@page import="java.util.Vector"%>
<%@page import="com.aula.web.alex.Util"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <title>Listar Todos Os Funcionários</title>

        <link rel="stylesheet" href="/SistemaWeb/Css/style.css" type="text/css"/>
    </head>


    <body class="fundo" > 
                
    <h1>           
        Listar Todos Funcionários

    </h1>

    <%
        Vector<Funcionario> lista = Util.getInstance().getFuncionario();
        double a = 0;
        for (Funcionario f : lista) {
            out.write("<table width = \"1200px\" align=\"center\" border=\"0\">");
            out.write("<tr>");
            
            out.write("<td width = \"20px\">");
            out.write(" Codigo: ");
            out.write("</td>");

            out.write("<td width = \"20px\" >");
            out.write(String.valueOf(f.getCodigo()));
            out.write("</td>");
            
            out.write("<td width = \"30px\" >");
            out.write("Nome: ");
            out.write("</td>");
            
            out.write("<td width = \"200px\">");
            out.write(f.getNome());
            out.write("</td>");
            
            out.write("<td width = \"30px\" >");
            out.write("Salario: ");
            out.write("</td>");
            
            out.write("<td width = \"30px\">");
            out.write(String.valueOf(f.getSalario()));
            out.write("</td>");

            out.write("<tr>");
            out.write("</table>");


                        
            a = a + f.getSalario();

        }
        
        out.write("<table align=\"center\" border=\"0\">");
        
        out.write("<tr>");
        out.write("<td >");
        out.write("O número total de funcionarios é: " + lista.size());
        out.write("</td>");
        out.write("</tr>");
        
        out.write("<tr>");
        out.write("<td >");
        out.write("O total do valor do salarios é: " + a);
        out.write("</td>");
        out.write("</tr>");
        
        out.write("</table>");


    %>

    <a class="v"  href="index.jsp">Voltar ao menu principal</a>
    
    </body>
</html>
